﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NewsEdit.ascx.cs" Inherits="Controls_BackEnd_NewsEdit" %>
<%@ Import Namespace="Business" %>
<%@ Register Src="../Common/RadEditor.ascx" TagName="AjaxEditor" TagPrefix="uc1" %>
<%@ Register Assembly="ASTreeView" Namespace="Geekees.Common.Controls" TagPrefix="ct" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <!-- start content-outer -->
        <div id="content-outer">
            <!-- start content -->
            <div id="content">
                <div id="page-heading">
                    <h1>
                        <%=string.Format(Resources.Resource.Update,Resources.Resource.NewsList.ToLower()) %></h1>
                </div>
                <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
                    <tr>
                        <th rowspan="3" class="sized">
                            <img src="<%=Config.ApplicationUrl %>resources/images/admin/shared/side_shadowleft.jpg"
                                width="20" height="300" alt="" />
                        </th>
                        <th class="topleft">
                        </th>
                        <td id="tbl-border-top">
                            &nbsp;
                        </td>
                        <th class="topright">
                        </th>
                        <th rowspan="3" class="sized">
                            <img src="<%=Config.ApplicationUrl %>resources/images/admin/shared/side_shadowright.jpg"
                                width="20" height="300" alt="" />
                        </th>
                    </tr>
                    <tr>
                        <td id="tbl-border-left">
                        </td>
                        <td>
                            <!--  start content-table-inner -->
                            <div id="content-table-inner">
                                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                    <tr valign="top">
                                        <td>
                                            <!-- start id-form -->
                                            <table border="0" cellpadding="0" cellspacing="0" id="id-form">
                                                <tr>
                                                    <th valign="top">
                                                        <%= Resources.Resource.Title%>
                                                        :
                                                    </th>
                                                    <td>
                                                        <asp:TextBox ID="txtTitle" class="inp-form" MaxLength="128" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td rowspan="6">
                                                        <%-- <div class="error-left">
                                                        </div>
                                                        <div class="error-inner">
                                                            This field is required.</div>--%>
                                                        <asp:Image ID="ImgAvarta" runat="server" Height="120px" ImageUrl="~/Resources/images/admin/forms/NoImages.jpg"
                                                            Width="120px" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th valign="top">
                                                        <%= Resources.Resource.Summary%>
                                                        :
                                                    </th>
                                                    <td>
                                                        <asp:TextBox ID="txtSummary" TextMode="MultiLine" class="form-textarea" MaxLength="1000"
                                                            runat="server"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th valign="top">
                                                        <%=Resources.Resource.NewsCategory%>
                                                        :
                                                    </th>
                                                    <td>
                                                        <ct:ASDropDownTreeView ID="astvMyTree" runat="server" BasePath="~/Resources/JS/treeview/astreeview/"
                                                            DataTableRootNodeValue="0" EnableRoot="false" EnableNodeSelection="false" EnableCheckbox="true"
                                                            EnableDragDrop="true" EnableTreeLines="true" EnableNodeIcon="true" EnableCustomizedNodeIcon="false"
                                                            EnableDebugMode="false" EnableRequiredValidator="true" InitialDropdownText="<span style='color:green;'>Please select</span>"
                                                            Width="390px" EnableCloseOnOutsideClick="true" EnableHalfCheckedAsChecked="true"
                                                            RequiredValidatorValidationGroup="vgCheck" EnableContextMenuAdd="false" EnableThreeStateCheckbox="false"
                                                            MaxDropdownHeight="200" />                                                      
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th valign="top">
                                                        <%=Resources.Resource.Status%>
                                                        :
                                                    </th>
                                                    <td>
                                                        <asp:DropDownList ID="ddlStatus" class="styledselect_form_1" runat="server">
                                                            <asp:ListItem Value="0" Text="Đang soạn"></asp:ListItem>
                                                            <asp:ListItem Value="1" Text="Đã duyệt"></asp:ListItem>
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th valign="top">
                                                        <%=Resources.Resource.Avata%>
                                                        :
                                                    </th>
                                                    <td style="width: 420px;">
                                                        <div style="float: left; width: 190px; height: 25px">
                                                            <asp:TextBox ID="txtImage" Style="cursor: pointer;" ToolTip="Click heer to upload image."
                                                                ReadOnly="true" class="inp-form" runat="server"></asp:TextBox></div>
                                                        <div style="float: left; width: 22px; height: 25px; margin-left: 10px">
                                                            <img id="img1" onclick="WareHouseImage();" style="cursor: pointer;" src="<%=Config.ApplicationUrl %>resources/images/admin/forms/icon_calendar.jpg"
                                                                alt="" />
                                                        </div>
                                                        <div style="float: left; width: 180px; height: 25px; margin-left: 10px">
                                                            <div class="bubble-left">
                                                            </div>
                                                            <div class="bubble-inner">
                                                                JPEG, GIF 5MB max per image</div>
                                                            <div class="bubble-right">
                                                            </div>
                                                        </div>
                                                    </td>
                                                    <td style="text-align: left; min-width: 100px;">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th valign="top">
                                                    </th>
                                                    <td style="color: #2E74B2; font-weight: normal; font-style: italic;">
                                                        <%=Resources.Resource.DesImage%>
                                                        :
                                                    </td>
                                                    <td>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th valign="top">
                                                        <%=Resources.Resource.TitleImage%>
                                                        :
                                                    </th>
                                                    <td>
                                                        <asp:TextBox ID="txtTitleImage" class="inp-form" MaxLength="128" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th valign="top">
                                                        <%=Resources.Resource.Content%>
                                                        :
                                                    </th>
                                                    <td colspan="2" style="width: 100%">
                                                        <uc1:AjaxEditor Width="100%" Height="600px" ID="AjaxEditor1" runat="server" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th>
                                                        &nbsp;
                                                    </th>
                                                    <td valign="top">
                                                        <asp:Button ID="btnSave" OnClientClick="if(!CheckNull())return false;" class="form-submit"
                                                            OnClick="AllCommand" runat="server" />
                                                        <asp:Button ID="btnReset" class="form-reset" OnClick="AllCommand" runat="server" />
                                                        &nbsp;<asp:Button Style="margin-left: 5px;" ID="btnBack" class="form-back" OnClick="AllCommand"
                                                            Text="Back" runat="server" />
                                                    </td>
                                                    <td>
                                                    </td>
                                                </tr>
                                            </table>
                                            <!-- end id-form  -->
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <img src="<%=Config.ApplicationUrl %>resources/images/admin/shared/blank.gif" width="695"
                                                height="1" alt="blank" />
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                </table>
                                <div class="clear">
                                </div>
                            </div>
                            <!--  end content-table-inner  -->
                        </td>
                        <td id="tbl-border-right">
                        </td>
                    </tr>
                    <tr>
                        <th class="sized bottomleft">
                        </th>
                        <td id="tbl-border-bottom">
                            &nbsp;
                        </td>
                        <th class="sized bottomright">
                        </th>
                    </tr>
                </table>
                <div class="clear">
                    &nbsp;</div>
            </div>
            <!--  end content -->
            <div class="clear">
                &nbsp;</div>
        </div>
        <link href="<%=Config.ApplicationUrl%>Resources/JS/treeview/astreeview/astreeview.css" type="text/css" rel="stylesheet" />
	<link href="<%=Config.ApplicationUrl%>Resources/JS/treeview/contextmenu/contextmenu.css" type="text/css" rel="stylesheet" />
	<link href="<%=Config.ApplicationUrl%>Resources/JS/treeview/asdropdowntreeview/dropdowntreeview.css" type="text/css" rel="stylesheet" />

	<script src="<%=Config.ApplicationUrl%>Resources/JS/treeview/astreeview/astreeview_packed.js" type="text/javascript"></script>
	<script src="<%=Config.ApplicationUrl%>Resources/JS/treeview/contextmenu/contextmenu_packed.js" type="text/javascript"></script>
        <!--  end content-outer -->
        <asp:HiddenField ID="hdfimg" runat="server" />
        <script language="javascript" type="text/javascript">            CheckNull = function () { var control = $control('<%=txtTitle.ClientID %>'); if (control.value.length < 1 || Trim(control.value).length < 1) { control.focus(); control.className = 'inp-form-error'; jAlert('<%=string.Format(Resources.Resource.InputData,Resources.Resource.Title) %>', '<%=Resources.Resource.Warning %>'); return false; } control.className = 'inp-form'; return true; }</script>
        <script type="text/javascript">            
            document.getElementById('ctl00_ContentPlaceHolder1_ctl00_astvMyTree_tbDropDown').className = '';
            document.getElementById('ctl00_ContentPlaceHolder1_ctl00_astvMyTree_trDropDownTR').className = 'styledselect_form_3';
           
            reloadpage = function () {
               $('.styledselect_form_1').selectbox({ inputClass: "styledselect_form_1" });
               $('.styledselect_form_2').selectbox({ inputClass: "styledselect_form_2" });
               document.getElementById('ctl00_ContentPlaceHolder1_ctl00_astvMyTree_tbDropDown').className = '';
               document.getElementById('ctl00_ContentPlaceHolder1_ctl00_astvMyTree_trDropDownTR').className = 'styledselect_form_3';
            }          
            openUpload = function () {
                ShowPopup(450, 200, '<%=Config.ApplicationUrl%>pages/Upload.aspx', 'Upload file');
            }
            getImage = function (img) {
                $control('<%=txtImage.ClientID %>').value = img;
                $control('<%=ImgAvarta.ClientID %>').src = img;
                $control('<%=hdfimg.ClientID %>').value = img;
                UnLoading();
            }
            WareHouseImage = function () {
                ShowPopup(750, 500, '<%= Config.ApplicationUrl%>pages/popup.aspx?ty=img', 'Warehouse Images');
            }
         
        </script>
    </ContentTemplate>
</asp:UpdatePanel>
